<?php

/**
 * SearchForm class.
 * SearchForm is the data structure for keeping
 * user search form data. It is used by the 'search' action of 'ReportController'.
 */
class StockSearchForm extends CFormModel
{
	public $eparchy_code;
	public $depart_code;
	public $start_date;
	public $end_date;
	public $producttype_code;
	public $product_id;
	
	public $old_eparchy_code;
	public $old_depart_code;
	public $old_start_date;
	public $old_end_date;
	public $old_producttype_code;
	public $old_product_id;

	/**
	 * Declares the validation rules.
	 * The rules state that username and password are required,
	 * and password needs to be authenticated.
	 */
	public function rules()
	{
		return array(
			// username and password are required
			array('eparchy_code, depart_code, start_date, end_date, producttype_code, product_id, old_producttype_code, old_product_id, old_depart_code, old_start_date, old_end_date', 'safe'),
			// rememberMe needs to be a boolean
			//array('start_date, end_date', 'date'),
		);
	}

	/**
	 * Declares attribute labels.
	 */
	public function attributeLabels()
	{
		return array(
			'eparchy_code'=>'地市编码',
			'depart_code'=>'营业厅',
			'start_date'=>'开始日期',
			'end_date'=>'结束日期',
			'producttype_code'=>'产品类型',
			'product_id'=>'产品型号',
		);
	}


	/**
	 * 保存检索查询条件
	 */
	public function saveCondition()
	{
		$this->old_eparchy_code = $this->eparchy_code;
		$this->old_depart_code = $this->depart_code;
		$this->old_start_date = $this->start_date;
		$this->old_end_date = $this->end_date;
		$this->old_producttype_code = $this->producttype_code;
		$this->old_product_id = $this->product_id;
	}
}
